package com.ruoyi.system.domain.survey;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 问题对象 survey_question
 * 
 */
public class SurveyQuestion extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 问题ID */
    private Long questionId;

    /** 问卷ID */
    private Long surveyId;

    /** 问题标题 */
    @Excel(name = "问题标题")
    private String title;

    /** 问题类型（radio单选 checkbox多选 text填空 rate评分） */
    @Excel(name = "问题类型", readConverterExp = "r=adio单选,c=heckbox多选,t=ext填空,r=ate评分")
    private String type;

    /** 是否必填（0非必填 1必填） */
    @Excel(name = "是否必填", readConverterExp = "0=非必填,1=必填")
    private Integer required;

    /** 排序 */
    @Excel(name = "排序")
    private Integer sort;

    /** 选项JSON（单选/多选题） */
    private String options;
    
    /** 选项列表，用于前端展示 */
    private List<Map<String, Object>> optionsList;

    /** 最大评分（评分题） */
    @Excel(name = "最大评分", readConverterExp = "评=分题")
    private Integer maxScore;

    /** 输入框行数（填空题） */
    @Excel(name = "输入框行数", readConverterExp = "填=空题")
    private Integer rows;

    /** 输入框占位文本（填空题） */
    private String placeholder;
    
    /** 统计信息 - 答题人数 */
    private Integer answerCount;
    
    /** 统计信息 - 每个选项的选择次数和百分比 */
    private List<Map<String, Object>> optionsStats;
    
    /** 统计信息 - 文本答案列表 */
    private List<String> textAnswers;
    
    /** 统计信息 - 评分平均分 */
    private Double averageScore;

    public Long getQuestionId() {
        return questionId;
    }

    public void setQuestionId(Long questionId) {
        this.questionId = questionId;
    }

    public Long getSurveyId() {
        return surveyId;
    }

    public void setSurveyId(Long surveyId) {
        this.surveyId = surveyId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getRequired() {
        return required;
    }

    public void setRequired(Integer required) {
        this.required = required;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getOptions() {
        return options;
    }

    public void setOptions(String options) {
        this.options = options;
    }

    public List<Map<String, Object>> getOptionsList() {
        return optionsList;
    }

    public void setOptionsList(List<Map<String, Object>> optionsList) {
        this.optionsList = optionsList;
    }

    public Integer getMaxScore() {
        return maxScore;
    }

    public void setMaxScore(Integer maxScore) {
        this.maxScore = maxScore;
    }

    public Integer getRows() {
        return rows;
    }

    public void setRows(Integer rows) {
        this.rows = rows;
    }

    public String getPlaceholder() {
        return placeholder;
    }

    public void setPlaceholder(String placeholder) {
        this.placeholder = placeholder;
    }

    public Integer getAnswerCount() {
        return answerCount;
    }

    public void setAnswerCount(Integer answerCount) {
        this.answerCount = answerCount;
    }

    public List<Map<String, Object>> getOptionsStats() {
        return optionsStats;
    }

    public void setOptionsStats(List<Map<String, Object>> optionsStats) {
        this.optionsStats = optionsStats;
    }

    public List<String> getTextAnswers() {
        return textAnswers;
    }

    public void setTextAnswers(List<String> textAnswers) {
        this.textAnswers = textAnswers;
    }

    public Double getAverageScore() {
        return averageScore;
    }

    public void setAverageScore(Double averageScore) {
        this.averageScore = averageScore;
    }

    @Override
    public String toString() {
        return "SurveyQuestion [questionId=" + questionId + ", surveyId=" + surveyId + ", title=" + title + ", type="
                + type + "]";
    }
} 